package com.xiaoyun.activiti02;


import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.repository.ProcessDefinitionQuery;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.runtime.ProcessInstanceQuery;
import org.apache.commons.io.IOUtils;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * 启动流程实例，添加进businessKey
 */
public class BusinessKeyAdd {

    public static void main(String[] args) throws IOException {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        RuntimeService runtimeService = processEngine.getRuntimeService();
        //businessKey业务标识
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("holiday", "1001");

        System.out.println(processInstance.getBusinessKey());

    }
}
